/**
* Copyright @ 2023 iAuto (Shanghai) Co., Ltd.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are NOT permitted except as agreed by
* iAuto (Shanghai) Co., Ltd.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/


/**
 * @description 抽绎，应该用不上
 */
import { CloseOutlined } from '@ant-design/icons';
import { Drawer, DrawerProps } from 'antd';
import React, { ReactNode } from 'react';

interface IProps extends DrawerProps {
  children: ReactNode;
  onClose: () => void;
  title: ReactNode;
}

export default ({ children, onClose, title, ...restProps }: IProps) => {
  return (
    <Drawer
      closable={false}
      maskClosable={false}
      onClose={onClose}
      title={title}
      extra={<CloseOutlined onClick={onClose} />}
      {...restProps}
    >
      {children}
    </Drawer>
  );
};
